

#pragma once

#include "zdbmain.h"
#include "zacgimaterial.h"

#pragma pack (push, 8)

class UcDbMaterial : public UcDbObject
{
public:
    UCDB_DECLARE_MEMBERS(UcDbMaterial);

    UcDbMaterial();
    virtual ~UcDbMaterial();

    virtual Ucad::ErrorStatus   setName (const ZTCHAR * pName);
    virtual const ZTCHAR *       name    (void) const;

    virtual Ucad::ErrorStatus   setDescription(const ZTCHAR * pDescription);
    virtual const ZTCHAR *       description(void) const;

    virtual void setAmbient     (const UcGiMaterialColor & color);
    virtual void ambient        (UcGiMaterialColor & color) const;

    virtual void setDiffuse     (const UcGiMaterialColor & color, 
                                 const UcGiMaterialMap & map);
    virtual void diffuse        (UcGiMaterialColor & color, 
                                 UcGiMaterialMap & map) const;

    virtual void setSpecular    (const UcGiMaterialColor & color, 
                                 const UcGiMaterialMap & map,                                
                                 double dGloss);
    virtual void specular       (UcGiMaterialColor & color, 
                                 UcGiMaterialMap & map,                                
                                 double & dGloss) const;

    virtual void setReflection  (const UcGiMaterialMap & map);
    virtual void reflection     (UcGiMaterialMap & map) const;

    virtual void setOpacity     (double dPercentage, 
                                 const UcGiMaterialMap & map);
    virtual void opacity        (double & dPercentage, 
                                 UcGiMaterialMap & map) const;

    virtual void setBump        (const UcGiMaterialMap & map);
    virtual void bump           (UcGiMaterialMap & map) const;

    virtual void setRefraction  (double dIndex, 
                                 const UcGiMaterialMap & map);
    virtual void refraction     (double & dIndex, 
                                 UcGiMaterialMap & map) const;

    virtual double translucence() const;
    virtual Ucad::ErrorStatus setTranslucence(double value);

    virtual double selfIllumination() const;
    virtual Ucad::ErrorStatus setSelfIllumination(double value);

    virtual double reflectivity() const;
    virtual Ucad::ErrorStatus setReflectivity(double value);

    virtual UcGiMaterialTraits::IlluminationModel illuminationModel() const;
    virtual Ucad::ErrorStatus setIlluminationModel(UcGiMaterialTraits::IlluminationModel model);

    virtual UcGiMaterialTraits::ChannelFlags channelFlags() const;
    virtual Ucad::ErrorStatus setChannelFlags(UcGiMaterialTraits::ChannelFlags value);

    virtual UcGiMaterialTraits::Mode mode() const;
    virtual Ucad::ErrorStatus setMode(UcGiMaterialTraits::Mode value);
    virtual Ucad::ErrorStatus dwgInFields  (UcDbDwgFiler* pFiler);
    virtual Ucad::ErrorStatus dwgOutFields (UcDbDwgFiler* pFiler) const;
    virtual Ucad::ErrorStatus dxfInFields  (UcDbDxfFiler* pFiler);
    virtual Ucad::ErrorStatus dxfOutFields (UcDbDxfFiler* pFiler) const;
    virtual UcGiDrawable*     drawable     (void);
    virtual void              setGsNode    (UcGsNode* pNode);
    virtual UcGsNode*         gsNode       (void) const;

    virtual ZSoft::UInt32  setAttributes (UcGiDrawableTraits* pTraits);

    virtual Ucad::ErrorStatus getClassID(CLSID* pClsid) const;
    double              colorBleedScale         () const;
    Ucad::ErrorStatus   setColorBleedScale      (double value);

    double              indirectBumpScale       () const;
    Ucad::ErrorStatus   setIndirectBumpScale    (double value);

    double              reflectanceScale        () const;
    Ucad::ErrorStatus   setReflectanceScale     (double value);

    double              transmittanceScale      () const;
    Ucad::ErrorStatus   setTransmittanceScale   (double value);

    ZSoft::Boolean      twoSided                () const;
    Ucad::ErrorStatus   setTwoSided             (ZSoft::Boolean value);

    UcGiMaterialTraits::LuminanceMode luminanceMode () const;
    Ucad::ErrorStatus   setLuminanceMode        (UcGiMaterialTraits::LuminanceMode value);

    double              luminance               () const;
    Ucad::ErrorStatus   setLuminance            (double value);

    double              shininess               () const;
    Ucad::ErrorStatus   setShininess            (double value);

    Ucad::ErrorStatus   normalMap               (UcGiMaterialMap & map,
                                                 UcGiMaterialTraits::NormalMapMethod & method,
                                                 double & strength) const;
    Ucad::ErrorStatus   setNormalMap            (const UcGiMaterialMap & map,
                                                 UcGiMaterialTraits::NormalMapMethod method,
                                                 double strength);

    ZSoft::Boolean      isAnonymous             () const;
    Ucad::ErrorStatus   setAnonymous            (ZSoft::Boolean isAnonymous);

    UcGiMaterialTraits::GlobalIlluminationMode globalIllumination() const;
    void                setGlobalIllumination   (UcGiMaterialTraits::GlobalIlluminationMode mode);

    UcGiMaterialTraits::FinalGatherMode        finalGather() const;
    void                setFinalGather          (UcGiMaterialTraits::FinalGatherMode mode);
};

#pragma pack (pop)


